package com.ljcalc.business.components;

public class ConsecutiveSpacePattern {

	private int consecutiveIndex;
	private int space;

	private int onceCounter=0;
	private int twiceCounter=0;
	private int threeTimesCounter = 0;;

	public ConsecutiveSpacePattern(int consecutiveIndex, int space) {
		this.consecutiveIndex = consecutiveIndex;
		this.space = space;
	}

	public void setOnceCounter(int onlyonce) {
		this.onceCounter = onlyonce;
	}

	public void setTwiceCounter(int twice) {
		this.twiceCounter = twice;
	}

	public void setThreeTimesCounter(int threetimes) {
		this.threeTimesCounter  = threetimes;
	}
	
	public int getOnceCounter() {
		return onceCounter;
	}

	public int getTwiceCounter() {
		return twiceCounter;
	}

	public int getThreeTimesCounter() {
		return threeTimesCounter;
	}

	
	public String toString() {
		// TODO Auto-generated method stub
		return "["+this.onceCounter+", "+this.twiceCounter+", "+this.threeTimesCounter+"] index=" + this.consecutiveIndex + ", space=" + this.space;
	}
	
	public boolean isValid(){
		return (!(onceCounter==0))||(!(twiceCounter==0))||(!(threeTimesCounter==0));
	}

	public String getKey() {
		// TODO Auto-generated method stub
		return "csp"+consecutiveIndex+":"+space;
	}
	

}
